package com.service.impl;

import com.domain.Comment;
import com.mapper.CommentMapper;
import com.service.CommentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentMapper commentMapper;

    //send
    @Transactional
    public int sendComment(Comment comment){
        return commentMapper.sendComment(comment);
    }
    //findAllComment
    public List<Comment> findAllComment() {
        return commentMapper.findAllComment();
    }
    //deleteComment
    @Transactional
    public void deleteComment(int id) {
        commentMapper.deleteComment(id);
    }
}
